/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-04-05     Administrator       the first version
 */
#ifndef APPLICATIONS_MQTT_MQTT_NET_H_
#define APPLICATIONS_MQTT_MQTT_NET_H_

#include <rtthread.h>

#endif /* APPLICATIONS_MQTT_MQTT_NET_H_ */

#ifdef PKG_USING_AT_DEVICE

#define ESP8266_DEIVCE_NAME             "esp0"
#define ESP8266_CLIENT_NAME             "uart2"
#define ESP8266_RECV_BUFF_LEN           2048


#define W5500_CS_GPIO                   GPIOB
#define W5500_CS_GPIO_PIN               GPIO_PIN_1
#define W5500_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOB_CLK_ENABLE()

#define W5500_SPI                       "spi5"
#define W5500_SPI0                      "spi50"

#define DEFAULT_NET_TYPE        1 // 网络类型： 1：无线网 2：有线网
#define DEFAULT_NET_WIFI_SSID   "TP-LINK_FSC"
#define DEFAULT_NET_WIFI_PWD    "1a2b3c4d5e6f7"
#define DEFAULT_NET_ETH_MAC     "11:22:33:44:55:66"
typedef struct NetConfig
{
    char NET_TYPE[3]; // '1': 无线 '2': 有线
    char NET_WIFI_SSID[20];
    char NET_WIFI_PWD[20];
    char NET_ETH_MAC[32];
} NetConfig;

uint8_t net_init();
int net_is_connected(void);

struct NetConfig net_get_conf(); 
void net_set_conf(struct NetConfig cfg); 

#endif
